<?php

/**
 * 微信信息发送驱动类
 */
class WXMsg extends Msg{	
	//引用微信类，调用发送方法发送文本信息
	public function sendMsg(){
		Vendor('Weixin.Weixin');
		$d['token']=getSysVal('token');
		$d['appid']=getSysVal('appid');
		$d['appsecret']=getSysVal('appsecret');
		$weixin=new WeixinChat($d);
		$ret = $weixin -> sendCustomMessage($this->touser, $this->content);
		if($ret){
			return true;
		}else{
			$this->error=$weixin->getError();
			return false;	
		}
	}
}